from rest_framework import serializers
from lifeHandbook.models import LifeHandbookDirection, LifeHandbookClassification, LifeHandbookArticlesContent

# 生活手册方向序列化器
class LifeHandbookDirectionSerializer(serializers.ModelSerializer):
    class Meta:
        model = LifeHandbookDirection
        fields = [
            'id', 
            'name'
        ]

# 生活手册分类序列化器
class LifeHandbookClassificationSerializer(serializers.ModelSerializer):
    class Meta:
        model = LifeHandbookClassification
        fields = [
            'id', 
            'name', 
            'handbook_direction'
        ]

# 生活手册文章序列化器
class LifeHandbookArticlesContentSerializer(serializers.ModelSerializer):
    class Meta:
        model = LifeHandbookArticlesContent
        fields = [
            'id', 
            'manual_title', 
            'manual_Time', 
            'manual_author', 
            'manual_images', 
            'manual_content', 
            'handbook_articles'
        ]